<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>欢迎您使用此系统！</title>
<%--    当前用户：${sessionScope.user.username}--%>
</head>
<body onload="myfunction()">
<h1>欢迎使用本系统</h1>
<%--    <script type="text/javascript">window.onload=function (){alert("自动加载")}</script>--%>
    <input value="${user.username}" type="hidden" id="username">
    <script type="text/javascript">
        function myfunction(){
            var username = $("input[id='username']").val();
            alert(username);
            // alert("自动加载");
        }
    </script>
    当前用户：${sessionScope.user.username}
    <script type=“text/javascript”>
        function myfunction(){
        var user = "<%=session.getAttribute("user")%>";
        alert(user);
        }
    </script>
</body>
</html>
